package com.zbkj.crmeb.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zbkj.crmeb.chant.model.ChannelMerchant;
import com.zbkj.crmeb.store.model.StoreOrder;
import com.zbkj.crmeb.store.model.StoreOrderGroupInfo;
import com.zbkj.crmeb.store.model.StoreOrderInfo;
import com.zbkj.crmeb.store.response.StoreCartResponse;
import com.zbkj.crmeb.user.model.User;

import java.util.List;
import java.util.Map;

/**
 * 功能描述: 拼团订单相关服务
 * @Author: wangzh
 * @Date: 2022/12/1 14:09
 */
public interface StoreOrderGroupInfoService extends IService<StoreOrderGroupInfo> {


    /**
     * 功能描述: 拼团商品 设置拼团价以及活动时间、限购进行处理，不符合不生成订单信息
     * @Param: [currentUserInfo, storeCartResponse, channelMerchant, joinPersonNumber]
     * @Return: void
     * @Author: wangzh
     * @Date: 2022/12/2 15:05
     */
    void dealGroupActivityProduct(User currentUserInfo, List<StoreCartResponse> storeCartResponse, ChannelMerchant channelMerchant, Integer joinPersonNumber, String groupId);

    /**
     * 功能描述: 记录拼团信息
     * @Param: [storeOrder]
     * @Return: java.lang.Boolean
     * @Author: wangzh
     * @Date: 2022/12/2 17:22
     */
    Boolean startGroup(StoreOrder storeOrder, List<StoreOrderInfo> storeOrderInfoList);

    /**
     * 功能描述: 通过商品id获取开团信息
     * @Param: [productId]
     * @Return: java.util.List<java.lang.Integer>
     * @Author: wangzh
     * @Date: 2022/12/2 13:01
     */
    List<StoreOrderGroupInfo> getGroupOrderIds(Integer productId, Integer merId);

    /**
     * @Description: 返回商品拼团用户头像与名称
     * @param productId
     * @Return: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
     * @Author: wangzh
     * @Date: 2022/12/4 21:13
     */
    List<Map<String, Object>> getGroupOrderInfo(Integer productId, Integer merId);

    /**
     * @Description: 拼团定时任务，用于取消超过时间未拼成功的订单
     * @Return: void
     * @Author: wangzh
     * @Date: 2022/12/4 21:16
     */
    void overtimeAutoRefund();

    /**
     * 功能描述: 用户退款后，删除拼团信息
     * @Param: [storeOrder]
     * @Return: void
     * @Author: wangzh
     * @Date: 2022/12/14 17:31
     */
    void removeGroupInfo(StoreOrder storeOrder);
}
